﻿using System.ComponentModel.DataAnnotations;
using YWM.Dto;

namespace PLC.Interface.Variables
{
    public class VariableDto : EntityDto
    {
        [Required(ErrorMessage = "请选择通信组")]
        public long? GroupId { get; set; }

        [Required(ErrorMessage ="变量名称不能为空"),StringLength(50,ErrorMessage ="变量名称不能超过50个字符")]
        public string DisplayName { get; set; }

        public short StartIndex { get; set; }

        [Required(ErrorMessage = "请选择数据类型")]
        public byte? DataType { get; set; }

        public short OffsetOrLength { get; set; }

        public bool PosAlarm { get; set; }

        public bool NegAlarm { get; set; }

        public double Scale { get; set; }

        public double Offset { get; set; }

        [StringLength(255, ErrorMessage = "描述不能超过255个字符")]
        public string Description { get; set; }
    }
}
